from moviepy.editor import *

pic_dir = r'E:\songhq\video\picture'
fps = 1  # 视频的帧率 即每秒显示多少张图片
outPath = r'E:\songhq\video\图片视频.mp4'
if __name__ == '__main__':
    clips = ImageSequenceClip(pic_dir, fps=fps, with_mask=False, load_images=True)
    # codec 编码格式
    clips.write_videofile(outPath, codec="libx264", audio=False)
